<?php
require_once 'application/library/db/gcDaoFactory.php';
require_once 'application/constant/constant.php';
require_once 'application/constant/daoConfig.php';
require_once 'application/library/exception/gcExceptionDealer.php';

/**
 * site_services_newsEditService
 * 共通
 * @author    Suda
 * @version   1.0
 */

class site_services_newsEditService {
    
    private $objDaoFactory;

    /**
    * 构造函数
    */
    public function __construct(){
        $this->objDaoFactory=gcDaoFactory::getInstance();
    }


    public function pbGetNewsContent($strInfoNo){
        $objDao = $this->objDaoFactory->createDao(daoConfig::T_AD_M_SITE_INFO_DAO);
        $arrReturn = $objDao->pbGetNews($strInfoNo);
        return $arrReturn;
    }
    
    public function pbSaveNews($strInfoNo, $strTitle, $strContent) {
        $objDao = $this->objDaoFactory->createDao(daoConfig::T_AD_M_SITE_INFO_DAO);
        $arrParameter = array("Title" => $strTitle, "Content" => $strContent, "InfoNo" => $strInfoNo);
        return $objDao->pbSaveNews($arrParameter);
    }
    
    public function pbAddNews($strTitle, $strContent) {
        $objDao = $this->objDaoFactory->createDao(daoConfig::T_AD_M_SITE_INFO_DAO);
        $arrParameter = array("Title" => $strTitle, "Content" => $strContent);
        return $objDao->pbAddNews($arrParameter);
    }
    
    public function pbDeleteNews($strInfoNo) {
        $objDao = $this->objDaoFactory->createDao(daoConfig::T_AD_M_SITE_INFO_DAO);
        $objDao->pbDeleteNews($strInfoNo);
    }
}